﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using NetFtp.Core.Login;

public partial class ChangeMdp : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["USER_LOGIN"] == null)
            Response.Redirect("Default.aspx");
    }
    protected void cmdOk_Click(object sender, EventArgs e)
    {
        if (txtMdp.Text == txtMdp2.Text)
        {
            UserList liste = new UserList();
            User user;

            user = liste.ReturnUser(Session["USER_LOGIN"].ToString());
            liste.ChangePwd(user, txtMdp.Text);

            Response.Redirect("Ftp.aspx");
        }
        else
        {
            lblErreur.Text = GetGlobalResourceObject("General", "MDPDifferents").ToString();
            lblErreur.Visible = true;
        }
    }
}
